package com.mocha.bss.domain.general.feign;

import com.coffee.core.CoffeeResponse;
import com.coffee.log.capture.OperationLogBO;
import com.coffee.log.dispose.OperationLogService;
import com.mocha.bss.BssServerInfo;
import com.mocha.bss.feign.general.api.MochaOperationLogFeign;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

/**
 * @author: songkui
 * @since 2025/03/24
 **/
@RestController
@AllArgsConstructor
@RequestMapping(BssServerInfo.LOG_PATH)
@Slf4j
public class MochaOperationLogFeignImpl implements MochaOperationLogFeign {

    private final OperationLogService operationLogService;

    @Override
    public CoffeeResponse<?> dispose(OperationLogBO operationLogBO) {
        log.info("MochaOperationLogFeignImpl dispose operationLogBO:{}", operationLogBO);
        operationLogService.save(operationLogBO);
        return CoffeeResponse.success();
    }
}
